FILE(GLOB HEADERS *.h)
FILE(GLOB SOURCES *.cpp)

FILE(GLOB FTFONT_HEADERS FTFont/*.h)
FILE(GLOB FTFONT_SOURCES FTFont/*.cpp)

FILE(GLOB FTGLYPH_HEADERS FTGlyph/*.h)
FILE(GLOB FTGLYPH_SOURCES FTGlyph/*.cpp)

FILE(GLOB FTLAYOUT_HEADERS FTLayout/*.h)
FILE(GLOB FTLAYOUT_SOURCES FTLayout/*.cpp)

LIST(SORT HEADERS)
LIST(SORT SOURCES)
LIST(SORT FTFONT_HEADERS)
LIST(SORT FTFONT_SOURCES)
LIST(SORT FTGLYPH_HEADERS)
LIST(SORT FTGLYPH_SOURCES)
LIST(SORT FTLAYOUT_HEADERS)
LIST(SORT FTLAYOUT_SOURCES)

SET_SOURCE_FILES_PROPERTIES(
	${HEADERS}
	${SOURCES}
	${FTFONT_HEADERS}
	${FTFONT_SOURCES}
	${FTGLYPH_HEADERS}
	${FTGLYPH_SOURCES}
	${FTLAYOUT_HEADERS}
	${FTLAYOUT_SOURCES}
	PROPERTIES COMPILE_FLAGS -w
	)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${K3D_FREETYPE2_INCLUDE_DIRS})
LINK_DIRECTORIES(${K3D_FREETYPE2_LIB_DIRS})

K3D_ADD_LIBRARY(k3dsdk-ftgl SHARED ${HEADERS} ${SOURCES} ${FTFONT_HEADERS} ${FTFONT_SOURCES} ${FTGLYPH_HEADERS} ${FTGLYPH_SOURCES} ${FTLAYOUT_HEADERS} ${FTLAYOUT_SOURCES})

TARGET_LINK_LIBRARIES(k3dsdk-ftgl ${K3D_FREETYPE2_LIBS})
TARGET_LINK_LIBRARIES(k3dsdk-ftgl ${K3D_OPENGL_LIBRARIES})

INSTALL(TARGETS k3dsdk-ftgl
	RUNTIME DESTINATION bin
	LIBRARY DESTINATION ${K3D_LIBDIR}
	ARCHIVE DESTINATION ${K3D_LIBDIR})

